package com.xjj.myoa.dao;


import com.xjj.myoa.model.OaBuMen;
import com.xjj.myoa.model.OaUser;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface BuMenMapper {
    @Select(value = {"select id,ming_cheng,bm_phone,bm_emile,bm_address from oa_bumen"})
    List<OaBuMen> findBuMenList();

    @Delete(value={"DELETE FROM oa_bumen WHERE id = #{id}"} )//#{id} -->占位符 #{参数名}
    Boolean deleteBuMenById(int id);

    @Update(value={"update oa_bumen set ming_cheng = #{mingCheng},bm_phone=#{bmPhone},bm_emile=#{bmEmile}," +
            "bm_address=#{bmAddress} where id = #{id}" })
    Boolean updateBuMen(OaBuMen oaBuMen);

    @Insert(value={"insert into oa_bumen(ming_cheng,bm_phone,bm_emile,bm_address)" +
           " values(#{mingCheng},#{bmPhone},#{bmEmile},#{bmAddress}) "})
    boolean addBuMen(OaBuMen oaBuMen);
}
